﻿using Unity.VisualScripting;
using UnityEngine.InputSystem;

namespace DoDove
{
    public static class InputManagerInitDefaultMapExtensions
    {
        public static void InitDefaultMap(this InputManager inputManager)
        {
            inputManager.SwitchPlayerMap();
            //当前 map的action处理添加
            inputManager.AddInputHandler();
        }
    }

    public static class SwitchPlayerMapExtensions
    {
        public static void SwitchPlayerMap(this InputManager inputManager)
        {
            inputManager.SwitchInputActionMap(inputManager.CurInputActions.Player);
        }
    }

    public static class SwitchOtherMapExtensions
    {
        public static void SwitchOtherMap(this InputManager inputManager)
        {
            inputManager.SwitchInputActionMap(inputManager.CurInputActions.OtherMaps);
        }
    }

    public static class AddInputHandlerExtensions
    {
        public static void AddInputHandler(this InputManager inputManager)
        {
            inputManager.RegisterInputHandler(new InputActionPlayerHandler());
            inputManager.RegisterInputHandler(new InputActionOtherMapsHandler());
        }
    }
}